<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
		
		test();
			function test(){
				var year = prompt("请输入年份:");
				var month = prompt("请输入月份:");
				var day = prompt("请输入日份:");
				
				
				var count = 0;
				
				for (var i = 1; i < month; i++) {
					if(i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12){
						count+=31;
					}else if(i == 2 ){
						if(year%4==0 && year%100!=0 || year%400==0){
							count+=29;
						}else{
							count+=28;
						}
					}else{
						count+=30;
					}
				}
				
				alert("这一天是这一年中的第"+count+"天");
			}
		</script>
	</body>
</html>
